using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using AgileFx.ORM;
using AgileFx.ORM.Providers.EntityViewProviders;

using projectNS = Debugging.Models;
using intermediateNS = Debugging.Models.Intermediate;
using L2SNS = Debugging.Models.L2S;

namespace Debugging.Models
{
	public class UserMapping : ModelEntityMapping<projectNS.User, intermediateNS.User, L2SNS.User>
	{
		public UserMapping()
		{
			AddIdentityField<long>(e => e.Id); 
		}
	}
		
	[ClassMapping(typeof(UserMapping))]
	public partial class User : IEntityView<intermediateNS.User>	
	{
		private intermediateNS.User __intermediateEntity;
		public intermediateNS.User _intermediateEntity { get { return __intermediateEntity; } }
		public IntermediateEntity _getIntermediateEntity() { return __intermediateEntity; }
		
		//Fields		
		public long Id 
		{	
			get { return _intermediateEntity.Id; }
			set { _intermediateEntity.Id = value; }
		}
			
		//Navigation Properties
		public User() : this(new intermediateNS.User())
		{
		}
			
		public User(intermediateNS.User intermediateEntity)		{
			__intermediateEntity = intermediateEntity;
			__intermediateEntity._entityView = this;
		}		

		public static bool operator ==(User a, User b)
		{
			return a._equals(b);
		}
		
		public static bool operator !=(User a, User b)
		{
			return !a._equals(b);
		}
		
		public override bool Equals(System.Object obj)
		{
			return ((User)this)._equals(obj as User);
		}
	}
}
	
namespace Debugging.Models.Intermediate
{
	public class User : IntermediateEntity<projectNS.User, L2SNS.User>
	{		
			
		//Fields				
		public long Id 
		{	
			get { return __tableEntity.Id; }
			set { __tableEntity.Id = value; }
		}


		//Navigation Properties
		
		//Inherited Navigation Properties
						
		public User()
		{
			__tableEntity = new L2SNS.User();
			initFields();
		}
			
		public User(L2SNS.User tableEntity)
		{
			__tableEntity = tableEntity;
			initFields();
		}

		private void initFields()
		{
		}
	}
}
	
namespace Debugging.Models.L2S
{
	partial class User : ITableEntity<intermediateNS.User>
	{
        public intermediateNS.User _intermediateEntity { get; set; }
	
		public IntermediateEntity _getIntermediateEntity()
		{
			return _intermediateEntity;
		}		
			
		public void _setIntermediateEntity(IntermediateEntity intermediateEntity)
		{
			_intermediateEntity = intermediateEntity as intermediateNS.User;
		}
	}
}

